import { View } from "../../../mvc/core/View";
import { NetDispatcher } from "../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../mvc/ServerCommand";
import { ObjCreate } from "../common/ObjCreate";
import { SPetInfo } from "../../../../Message/Game/SPetInfo";
import { SMoney } from "../../../../Message/Game/SMoney";
import { SVIPInfo } from "../../../../Message/Game/SVIPInfo";
import { ExpAddEffect } from "../effect/ExpAddEffect";
import { ExpAddEffectInfo } from "../../resource/info/ExpAddEffectInfo";
import { AttributeTextType } from "../../scene/player/type/AttributeTextType";
type int = number;
//class PetNewBaseView
    
    export  class PetNewBaseView extends View
    {
        constructor()
        {
            super();
            this.init();
            NetDispatcher.addCmdListener(ServerCommand.MoneyUpdate, this.onMoneyUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.BackpackDataChange, this.onPackChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.BackPackItemsChange, this.onPackChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.VIPInfoUpdateCommand, this.onVIPInfoUpdateCommandHandler);
            return;
        }

        protected init(): void
        {
            this._tipTxt = ObjCreate.createTextField("", 13, 324, 550, 75, this);
            this._tipTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._tipTxt.multiline = true;
            this._tipTxt.wordWrap = true;
            this._tipTxt.mouseWheelEnabled = false;
            return;
        }

        public updateByPetInfo(arg1: SPetInfo): void
        {
            return;
        }

        public updateTip(arg1: string, arg2: int, arg3: int, arg4: int=75, arg5: int=565): void
        {
            this._tipTxt.htmlText = "<textFormat leading=\'5\'>" + arg1 + "</textFormat>";
            this._tipTxt.x = arg2;
            this._tipTxt.y = arg3;
            this._tipTxt.height = arg4;
            this._tipTxt.width = arg5;
            return;
        }

        protected onMoneyUpdateHandler(arg1: SMoney=null): void
        {
            return;
        }

        protected onPackChangeHandler(arg1: Object=null): void
        {
            return;
        }

        protected onVIPInfoUpdateCommandHandler(arg1: SVIPInfo): void
        {
            return;
        }

        public playValueAddEffect(arg1: int): void
        {
            var loc1=localToGlobal(new Object /* flash.geom.Point */(224, 240));
            var loc2=new ExpAddEffect(new ExpAddEffectInfo(loc1.x, loc1.y, loc1.x, loc1.y, arg1, 1, AttributeTextType.crit));
            loc2.playEffect();
            return;
        }

        protected /* var */_tipTxt: Object /* flash.text.TextField */;

        protected /* var */isMoneyEnough: Boolean;

        protected /* var */isMaterialEnough: Boolean;
    }
